/**
 * 
 */
package org.statewalker.fsm;

import java.util.List;

/**
 * This is a strategy used to provide new states and to select next sub-states.
 * 
 * @author kotelnikov
 */
public interface IFsmStateProvider<S, E> {

    /**
     * Returns the next sub-state of the specified parent state. This method
     * loads the description of the transition for the specified sub-state and
     * the given event in the parent's descriptor.
     * 
     * @param stack the stack of parent states
     * @param state the sub-state of the specified parent
     * @param event the event initializing the transition from the given
     *        sub-state
     * @return the next state corresponding to the specified transition
     */
    S getNextState(List<S> stack, S state, E event);
}
